package cn.gz.ibix.ibix_library.bean;

import java.util.HashMap;
import java.util.Map;

/**
 * 项目名称：android_tool
 * <br>类描述：
 * <br>创建人：htliu
 * <br>创建时间：2019/7/10 14:17
 * <br>修改人:
 * <br>修改时间：2019/7/10 14:17
 * <br>修改备注：
 * <br>@version
 */
public class ApiConfigManager {
    private Map<Environment, ApiConfig> map;

    private ApiConfigManager() {
        map = new HashMap<>(3);
        Map<ApiConfig.Server, String> testPrefix = new HashMap<>();
        testPrefix.put(ApiConfig.Server.USER, "/ZGCW-USER-SERVER");
        ApiConfig test = new ApiConfig("http://dev.zgcw.cn/gate", testPrefix);
        map.put(Environment.TEST, test);
    }

    private static class SingletonHolder {
        private static final ApiConfigManager INSTANCE = new ApiConfigManager();
    }

    public static ApiConfigManager getInstance() {
        return SingletonHolder.INSTANCE;
    }

    public ApiConfig getApiConfig() {
        return map.get(Environment.TEST);
    }


    public enum Environment {
        LOCAL,
        TEST,
        PROD

    }
}
